cc.Class({
    extends: cc.Component,

    properties: {
       show:cc.Label,
       collectCoins:cc.Node,
    },

    // LIFE-CYCLE CALLBACKS:

    // onLoad () {},

    start () {
        this.show.string = '+' + cc.diamondWin;
        this.collectDiamond = false;
    },
    showNext(){
        if(this.collectDiamond) return;
        cc.voicePlay.playEffect('click');
        this.collect = true;
        var diamond = cc.sys.localStorage.getItem("diamond")/1 + cc.diamondWin;
        cc.configData.diamond = cc.configData.diamond + cc.diamondWin;
        cc.sys.localStorage.setItem("diamond",diamond);
        console.log('diamond',diamond);
        cc.find('Canvas').emit('diamond');
        if(CC_JSB){
            this.collectCoins.active = true;
            this.node.active = false;
        }else{
            cc.sdkbox.setDataAsync(cc.configData,function(){
                this.collectCoins.active = true;
                this.node.active = false;
            }.bind(this));
        }
    }
    // update (dt) {},
});
